#pragma once

#include "6502.h"
#include "dead6502/dead6502.h"

class CDead6502v3:public C6502
	{
	public:
		CMachine *MachinePtr;
	protected:
		dead6502data dead6502;
	public:
		u8 A(){return(dead6502.a);}
		u8 X(){return(dead6502.x);}
		u8 Y(){return(dead6502.y);}
		u8 S(){return(dead6502.s);}
		u8 F(){return(dead6502.f);}
		u32 PC(){return(dead6502.pc);}
		u32 EA(){return(/*dead6502.eaddr*/0);}
		void SetMachine(CMachine *m);
		void SetOp(ReadFunc *r);
		void SetRead(ReadFunc *r);
		void SetWrite(WriteFunc *w);
		void SetUser(void *u);
		void Init();
		void Reset();
		void IRQ();
		void NMI();
		void SetOpPage(int p,u8 *d);
		void SetReadPage(int p,u8 *d);
		void SetWritePage(int p,u8 *d);
		void SetPage(int p,u8 *d);
		u32 Execute(u32 c);
		u8 Read(u32 addr);
		void Write(u32 addr,u8 data);
		u32 GetPC();
		u32 GetCycle(){return(dead6502.totalcycles);}
		u8 GetOpcode();
		u32 GetNextOpcodePC();
		u32 GetCurrentOpcodePC();
		void SaveState(CState *s);
		void LoadState(CState *s);
		u32 Disassemble(char *dest,u32 p);
		u32 GetLastRead();
		u32 GetLastWrite();
		int InsideIRQ();
		int InsideNMI();
		char *GenerateRegData(char *dest);
	};
